﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Runtime.Serialization;
using System.ServiceModel;
using System.ServiceModel.Channels;

namespace PSE.ProcessManager.Common.Gateway
{
    public interface IMessage
    {
        object Parameter { get; set; }
    }

    /// <summary>
    /// Classe utilizada no tráfego de mensagens entre o Process Manager.
    /// </summary>
    [DataContract]
    public class Message<T> : BaseMessage, IMessage
    {
        #region Propriedades

        [DataMember]
        public T Parameter { get; set; }
        
        #endregion

        #region Construtor
        public Message()
        {
        }
        #endregion

        #region IMessage Members

        object IMessage.Parameter
        {
            get { return this.Parameter; }
            set { this.Parameter = (T)value; }
        }

        #endregion
    }

    /// <summary>
    /// Classe utilizada no tráfego de mensagens entre o Process Manager.
    /// </summary>
    [DataContract]
    public class Message : BaseMessage
    {
        #region Construtor
        public Message()
        {
        }
        #endregion

    }
}
